/*
*
* Author: jff
*
* Date:
*
* Function:
*
*/
const path = require('path')
const webpack = require('webpack')
const htmlWebpackPlugin = require('html-webpack-plugin')
const vuePlugin = require('vue-loader/lib/plugin')
module.exports = {
    entry: path.join(__dirname, './src/main.js'),
    output: {
        path: path.join(__dirname, './dist'),
        filename: "bundle.js"
    },
    devServer: {
        port:3000,
        open:true,
        hot:true
    },
    module: {
        rules: [
            {test:/\.css$/, use: ['style-loader', 'css-loader']},
            {test:/\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader']},
            {test: /\.vue$/, use: 'vue-loader'},
            {test: /\.js$/, use: 'babel-loader', exclude: /node_modules/}
        ]
    },
    plugins: [
        new webpack.HotModuleReplacementPlugin(),
        new htmlWebpackPlugin({
            template: "./src/index.html",
            filename: "index.html"
        }),
        new vuePlugin()
    ],
    resolve: {
        alias: {
            'vue$': 'vue/dist/vue.js'
        }
    }
}
